﻿//-----------------------------------------------------------------------------------
// <copyright file="UnitTestMethodInvokerInfo.cs" company="P.O.S Informatique">
//     Copyright (c) P.O.S Informatique. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------------------
namespace PosInformatique.DevelopmentTools.VisualStudio.TestExtensions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;
    using PosInformatique.Framework;

    /// <summary>
    /// Represents info of the unit test method to execute.
    /// </summary>
    [Serializable]
    internal sealed class UnitTestMethodInvokerInfo
    {
        /// <summary>
        /// The unit test method to execute.
        /// </summary>
        private readonly MethodInfo method;

        /// <summary>
        /// Initializes a new instance of the <see cref="UnitTestMethodInvokerInfo"/> class.
        /// </summary>
        /// <param name="method">Unit test method to execute.</param>
        public UnitTestMethodInvokerInfo(MethodInfo method)
        {
            ContractHelper.IsNotNull(method);

            this.method = method;
        }

        /// <summary>
        /// Gets the unit test method to execute.
        /// </summary>
        public MethodInfo Method
        {
            get
            {
                ContractHelper.ReturnNonNull<MethodInfo>();

                return this.method;
            }
        }
    }
}
